home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Gamer Resource Kit / Hardcore Gamer Resource Kit - Disc 2.iso / Pc / P_R / P2DOSPTC.ZIP / PATCH.BAT < prev    next >
DOS Batch File  |  1997-01-16  |  9KB  |  366 lines

  1. @echo off
  2.  
  3. cls
  4. echo.
  5. echo. 
  6. echo Welcome to Phantasmagoria: A Puzzle of Flesh
  7. echo DOS Patch Install
  8. echo.
  9. echo.
  10. echo This utility will convert your Windows-95 version
  11. echo of Phantasmagoria: A Puzzle of Flesh to the DOS
  12. echo version.  If at any point you decide that you wish
  13. echo abort this process, press CONTROL-C.
  14. echo.
  15. echo.
  16. pause
  17.  
  18. REM **************************************************
  19. REM Test for dos v7, and warn user of possible problems
  20. REM **************************************************
  21. what d>nul
  22. if not errorlevel 70 goto nowarn
  23. cls
  24. echo.
  25. echo You are running DOS version 7 or higher.  If you are running
  26. echo DOS from a window in Windows 95, you may encounter problems
  27. echo installing this patch.  We recomend you run this program in
  28. echo from MS-DOS mode.  You may do this by clicking on the
  29. echo "Start" button in Windows 95, and choosing "Shutdown", then
  30. echo "Restart the computer in MS-DOS mode."  For further
  31. echo information, please see DOSPATCH.TXT.
  32. echo.
  33. echo If you are already in MS-DOS mode, or you wish to attempt the
  34. echo installation anyway, press Y, otherwise, press N to abort the
  35. echo patch install program.
  36. echo.
  37. choice Do you wish to continue with Patch Install?
  38. if errorlevel 2 goto abort
  39.  
  40. :nowarn
  41.  
  42. REM **************************************************
  43. REM init error tracking var
  44. REM **************************************************
  45. set patcherr=none
  46.  
  47. REM **************************************************
  48. REM save off current directory in install dir variable
  49. REM **************************************************
  50.  
  51. cd>install.dat
  52. what s<install.dat>nul
  53. set p2instdir=%what%
  54. del install.dat
  55.  
  56. REM **************************************************
  57. REM ask for CDROM drive letter
  58. REM **************************************************
  59.  
  60. :askcd
  61. cls
  62. echo.
  63. echo.
  64. echo.
  65. echo Please insert DISK ONE of Phantasmagoria: A Puzzle of Flesh
  66. echo in your CD-ROM drive.  After you have done so, please
  67. pause
  68. echo.
  69. echo.
  70. echo.
  71. echo Please type the drive letter of your CD-ROM.
  72. what c>nul
  73. set p2sourcedrive=%what%
  74.  
  75. REM **************************************************
  76. REM check for P2 in that drive
  77. REM **************************************************
  78.  
  79. echo.
  80. echo.
  81. echo.
  82. echo Checking for Phantasmagoria: A Puzzle of Flesh CD in drive %p2sourcedrive%:
  83. if not exist %p2sourcedrive%:\ressci.001 goto cderr
  84. echo.
  85. echo Found in drive %p2sourcedrive%:
  86. echo.
  87. pause
  88. goto askdrive
  89.  
  90. :cderr
  91. cls
  92. echo.
  93. echo.
  94. echo.
  95. echo Unable to detect the Phantasmagoria: A Puzzle of Flesh CD#1
  96. echo in drive %p2sourcedrive%:.  The drive letter may be incorrect,
  97. echo or the CD may not inserted in it, or the drive may not have been ready.
  98. pause
  99. goto askcd
  100.  
  101. REM **************************************************
  102. REM ask for install drive
  103. REM **************************************************
  104.  
  105. :askdrive
  106. cls
  107. echo.
  108. echo.
  109. echo.
  110. echo Please type the letter of the hard drive you wish
  111. echo to install Phantasmagoria - A Puzzle of Flesh to.
  112. what c>nul
  113. set p2destdrive=%what%
  114. if not exist %p2destdrive%:\nul goto driveerr
  115. what ke %p2destdrive%>nul
  116. if errorlevel 100 goto driveok
  117.  
  118. :driveerr
  119. echo.
  120. echo.
  121. echo The drive you have chosen does not have enough space
  122. echo or does not exist.  Do you wish to:
  123. echo (C)hoose another drive, or
  124. echo (E)xit install?
  125. choice /c:ec /n
  126. if errorlevel 2 goto askdrive
  127. goto abort
  128.  
  129. :driveok
  130. cls
  131. echo.
  132. echo.
  133. echo Drive %p2destdrive%: appears to have sufficient space for install.
  134. echo.
  135. echo.
  136. pause
  137.  
  138. REM **************************************************
  139. REM ask for the install path
  140. REM **************************************************
  141.  
  142. :askpath
  143. cls
  144. echo.
  145. echo.
  146. echo.
  147. echo Please enter the path (directory) you wish to install
  148. echo the game to.  If you do not wish to select a directory,
  149. echo just press ENTER, and the default \SIERRA\P2DOS will
  150. echo be used.
  151. echo .
  152. what s
  153. echo.
  154. echo Working...  Please wait.
  155. echo.
  156. set p2destpath=%what%
  157. if not errorlevel 1 goto skipadd
  158.  
  159. REM **************************************************
  160. REM check for a leading "\", and add if needed
  161. REM **************************************************
  162.  
  163. echo %p2destpath%>install.dat
  164. what c<install.dat>nul
  165. if not "%what%" == "\" set p2destpath=\%p2destpath%
  166. del install.dat
  167. :skipadd
  168.  
  169. REM **************************************************
  170. REM check for a trailing "\", and add if needed
  171. REM **************************************************
  172. echo %p2destpath%>install.dat
  173. REM now reverse it...
  174. set p2rev=
  175.  
  176. :dorev
  177. what c<install.dat>nul
  178. set p2rev=%what%%p2rev%
  179. popchar<install.dat>install.tmp
  180. if not errorlevel 1 goto revdone
  181. del install.dat
  182. ren install.tmp install.dat
  183. goto dorev
  184.  
  185. :revdone
  186. echo %p2rev%>install.dat
  187. what c<install.dat>nul
  188. if not "%what%" == "\" set p2destpath=%p2destpath%\
  189. del install.dat
  190. set p2rev=
  191.  
  192. REM **************************************************
  193. REM now, check for doubled "\"s, and remove them.
  194. REM **************************************************
  195. echo %p2destpath%>install.dat
  196. set p2destpath=
  197.  
  198. :lffs
  199. REM looking for first slash
  200. what c<install.dat>nul
  201. popchar<install.dat>install.tmp
  202. if not errorlevel 1 goto cdsdone
  203. del install.dat
  204. ren install.tmp install.dat
  205. set p2destpath=%p2destpath%%what%
  206. if not "%what%" == "\" goto lffs
  207.  
  208. :lfss
  209. REM look for subsequent slashes, and ignore them
  210. popchar<install.dat>nul
  211. if not errorlevel 1 goto cdsdone
  212. what c<install.dat>nul
  213. if not "%what%" == "\" goto lffs
  214. popchar<install.dat>install.tmp
  215. del install.dat
  216. ren install.tmp install.dat
  217. goto lfss
  218.  
  219. :cdsdone
  220. del install.dat
  221. if exist install.tmp del install.tmp
  222. REM **************************************************
  223. REM check for existance of path
  224. REM **************************************************
  225.  
  226. set p2dpf=unused
  227.  
  228. :checkpath
  229. if exist %p2destdrive%:%p2destpath%nul goto pathok
  230.  
  231. REM otherwise, lets make it for them
  232.  
  233. if "%p2dpf%" == "unused" goto makepath
  234. set patcherr=Error creating install directory.
  235. set p2dpf=
  236. rem ------------------------------------
  237. cls
  238. echo %patcherr%
  239. echo "%p2destpath%"
  240. rem *** goto patchfailed
  241. pause
  242. goto askpath
  243. rem ------------------------------------
  244.  
  245. :makepath
  246. echo %p2destpath%>install.dat
  247. set p2dpf=%p2destdrive%:
  248.  
  249. :builddir
  250. popchar<install.dat>nul
  251. if not errorlevel 1 goto wholepathread
  252. what c< install.dat>nul
  253. if not "%what%" == "\" set p2dpf=%p2dpf%%what%
  254. popchar<install.dat>install.tmp
  255. del install.dat
  256. ren install.tmp install.dat
  257. if "%what%" == "\" goto dirbuilt
  258. goto builddir
  259.  
  260. :dirbuilt
  261. if exist %p2dpf%\nul goto dbdone
  262. md %p2dpf%
  263. :dbdone
  264. set p2dpf=%p2dpf%\
  265. goto builddir
  266.  
  267. :wholepathread
  268. if not exist %p2dpf%\nul md %p2dpf%
  269. set p2dpf=
  270. del install.dat
  271. del install.tmp
  272. goto checkpath
  273.  
  274. :pathok
  275. cls
  276. if exist %p2destdrive%:%p2destpath%sierra\nul goto skipmdsierra
  277. md %p2destdrive%:%p2destpath%sierra
  278.  
  279. :skipmdsierra
  280. if exist %p2destdrive%:%p2destpath%sierra\p2dos\nul goto skipmdp2dos
  281. md %p2destdrive%:%p2destpath%sierra\p2dos
  282.  
  283. :skipmdp2dos
  284. set p2destpath=%p2destpath%sierra\p2dos
  285. if exist %p2destdrive%:%p2destpath%\nul goto pathdone
  286. set patcherr=Error creating install directory.
  287. rem ------------------------------------
  288. cls
  289. echo %patcherr%
  290. echo "%p2destpath%"
  291. rem *** goto patchfailed
  292. pause
  293. goto askpath
  294. rem ------------------------------------
  295.  
  296. :pathdone
  297. echo.
  298. echo.
  299. echo Phantasmagoria: A Puzzle of Flesh will be installed in
  300. echo %p2destdrive%:%p2destpath%
  301. echo.
  302. echo.
  303. pause
  304.  
  305. REM **************************************************
  306. REM start the installation process
  307. REM **************************************************
  308.  
  309. :begininstall
  310. cls
  311. rem ------------------------------------
  312. copy what.exe %p2destdrive%:%p2destpath%
  313. rem ------------------------------------
  314. call patch2.bat %p2destdrive% %p2sourcedrive% foo %p2destpath% %p2instdir%
  315. cls
  316. if %patcherr% == user_aborted goto abort
  317. if not %patcherr% == none goto patchfailed
  318. rem ------------------------------------
  319. goto end
  320. rem ------------------------------------
  321.  
  322. :abort
  323. cls
  324. echo.
  325. echo.
  326. echo DOS Patch Install has been aborted.
  327. echo.
  328. echo.
  329. goto done
  330.  
  331. :patchfailed
  332. cls
  333. echo.
  334. echo.
  335. echo DOS Patch Install has failed.
  336. echo.
  337. echo %patcherr%
  338. echo "%p2destpath%"
  339. echo.
  340. goto done
  341.  
  342. :end
  343. cls
  344. echo.
  345. echo.
  346. echo Phantasmagoria: A Puzzle of Flesh
  347. echo DOS Patch Install has been completed.
  348. echo.
  349. echo.
  350. echo Preparing to run INSTALL for driver setup
  351. echo.
  352. echo.
  353. pause
  354. rem ------------------------------------
  355. rem *** %p2destdrive%:
  356. rem ------------------------------------
  357. cd %p2destpath%
  358. call install.bat
  359.  
  360. :done
  361. set p2instdir=
  362. set p2destdrive=
  363. set p2sourcedrive=
  364. set p2destpath=
  365. set patcherr=
  366.